Magnetic Pages Article | 1997-05-21 | 47KB | 168 lines
MPARTICLE
81D2#
UU=Os
81D2#
@V(T
cc>>8
cc>>8
yx|^>
yx|^>
yx|^>
J(%IJP
J0%*JH
J(%*JD
30s`p
)JJRPB
JA)JA
)JJRPB
JA)JA
)IRRH!
)IRRH!
IRRD
IRRD
08p0|
JA&JAT
LHHLO
JA&JAT
LHHLO
K>
[35mGetting True ILBMInfo Results
LWelcome to another Blitztified, and a rather mixed bag it is this time too.LTo start off with we've a function to examine IFF picture files that (ILthink) gives true ILBMViewMode results. Blitz users who have tried to detectLHAM or EHB pictures using Acid's ILBMInfo followed by ILBMViewMode will knowLit doesn't work. (Attempting to save HAM or EHB pictures with Blitz alsoLdoesn't work as no "CAMG" chunk, which holds the HAM and EHB flags, isLincluded with the saved picture. Can anyone help with this?) This function,@by examining the start of the picture file, seems to do the job.
7; This function returns a correct ILBMViewMode. Meaning7; it correctly detects HAM and EHB pictures. It returns1; -1 if it doesn't find the file. Note it doesn't6; check if the file really is an ILBM IFF picture. Use4; another method to check for that. LoadPalette, for9; instance, will generate an error if a file isn't an IFF-; picture so that's one method you could use.%Function.l TrueViewMode{ILBMPicFile$}' fiLen.l=Exists(ILBMPicFile$):mode.l=-1 If fiLen* ILBMInfo(ILBMPicFile$):mode=ILBMViewMode
fiCount.l=0
If ReadFile(0,ILBMPicFile$)
FileInput 06 While fiCount<fiLen AND b$<>"CAMG" AND fiCount<5000* a$=Inkey$:b$=Right$(b$+a$,4):fiCount+1
Wend
If b$="CAMG"
c$=Inkey$(8)
EndIf
EndIf
CloseFile 0
DefaultInput
EndIf
If b$="CAMG", mode=(mode OR (Cvl(Mid$(c$,5)) AND $8da6))
EndIf
Function Return mode
End Function) ------
8
[35mMore Polygon Fun
LNow follows a little program that shows you how to use strings for storing aLlist of polygons with differing numbers of points. Since the last issue ofLSW (which contained a polygon example too) I've sussed out fully how BlitzLuses polygons, and it's all rather simple. All the polygon commands need,Lafter you tell them the number of points they have, is an address thatLpoints to a string of bytes containing the x,y coordinates as two-byteLwords. Thus an array of strings is a simple way to store and access polygonsLwith differing numbers of points, hence this not very exciting demo. (NobodyLhad anything to say about last issue's Polygon program. I wonder if this'll
prove any different?)
; PolyDemo 2.00
.; By Carl Read - Public Domain - 6th May 1997.
:; This is just a little BlitzII program to show how to use5; strings to store polygons with different numbers of ; points.
Use BitMap 0:Cls:BitMapOutput 06Dim p$(#pts) ; String array to hold the x,y points in.2Dim p(#pts) ; Number of points per array element.
; Create polygons.
points=3
For n=0 To #pts
Locate 2,2:Print #pts-n," "
If n=0
; Create first polygon.
For m=1 To points
x=Int(Rnd(#wid))
y=Int(Rnd(#ht))
p$(n)+Mki$(x)+Mki$(y)
Next
Else< ; Use previous polygon string as the basis of the new one.; ; Each previous point will be moved randomly a little bit; ; and the number of points may be increased or decreased,= ; with a bias in favour of increasing the number of points.
For m=1 To points*4 Step 4$ x=Cvi(Mid$(p$,m))+Int(Rnd(64))-32
If x<0 Then x=0
If x>=#wid Then x=#wid-1& y=Cvi(Mid$(p$,m+2))+Int(Rnd(40))-20
If y<0 Then y=0
If y>=#ht Then y=#ht-1
p$(n)+Mki$(x)+Mki$(y)
Next
EndIf
p(n)=points
If points=3
points+1
Else< ; The maximum number of points is 200. If you want to use; ; Polyf for filled polygons, (see below), then reduce the9 ; 200 to 8 or less else you'll most likely get a crash.< ; This is because the routine doesn't create true polygons: ; but ones where the edges cross over each other. Sorry= ; about this, but I've not enough time to think up a better
LAnyone sick of their Blitz menus being the wrong colour on Workbench 3Lmachines? Well try adding $200000 to your windows' flags. Yes folks, that'sLall that's required to give WB3 colours to your menus. In fact everybodyLshould use it as it has no effect on the earlier Workbenches. (Actually,Lthat's not quite true as it needs to be used with Red When Excited's WB2+Lmenus, which give not only the correct colours but also support for theLsystem fonts and so on. See the review of Blitz Support Suit in this issue.)
) ------
@
[35mBlitz Support and Where To Get It
LBlitz support, from those who gave us Blitz, leaves a little bit to beLdesired. So for any of you who are pulling your hair out trying to get BlitzLto do something you know it should be able to do, but won't do for you,Lhere's a list of software which may be of help to you. If you can't sourceLit yourself, except for the commercial products I can supply you with any ofJthis. Just send me some interesting Blitz related stuff on disk in return.
) ------
4 "Blitz on the Internet/Comms"
LThose with comms/Internet access can no doubt find Blitz support byLthemselves. However, us lesser mortals just have to hope some kind soulLpasses some of the info on to us. (Thanks Andy K. :) Anyway, I've about aLlha-crunched megabyte of such stuff derived (according to AmiQWK, a WB2+Lfile reader for such stuff), from "Blitz Basic Support" and "Alt Sys AmigaLBlitz". To find what you need to know from such a mass of text is a prettyLhopeless task using AmiQWK, (it having no search option), so it's mainly aLcase of reading through a lot of junk when you first receive these and0saving the odd pearls of wisdom you come across.
) ------
/ "Blitz Guide v1.3"- By Jurgen ValksE (Freeware: An AmigaGuide Document. Released 16th Oct. 1994.)
3 E-Mail: j.valks@hsbos.nl
D Realmail: Jurgen Valks, Kerkeind 8a, 5293 AB Gemonde (NB),. THE NETHERLANDS.
LThis AmigaGuide document contains a well-ordered guide to a lot of theLcommands added to Blitz by Acid and others after its initial release, thoughLthe version I have doesn't contain any info on commands after BUM7 wasLreleased. You can get at the individual commands through a library list, anLalphabetical list or via the commands added with each BUM up to number 7.LMissing I think is the ability to find them by category, (bitmap commands,Lpacking commands, etc.), but otherwise it's a useful resource. And big too -
the file's over 400k in size.
) ------
. "Guide To Blitz"- By Neil WrightF (From F1 Licenceware - UK
4.99. Two disks. Released Mar. 1996.)
I Realmail: Neil Wright, (Blitz User Group UK), 39 Riding Dene, Mickley,7 Northumberland, NE43 7DL, ENGLAND.
LThis two disk package consist of one disk of AmigaGuide documents containingLdetailed descriptions of most of the Acid commands, while the other containsLexamples, (over 400 of them and all in Blitz code), of how to use thoseLcommands. There's also an introduction to coding in Blitz plus a fewLprograms for you to examine. Very useful to Blitz users with only the later,Lexample-less, smaller manual and probably of quite a bit of use to mostLBlitz users in general. Reviewed fully in ShareWorld #7. (The previous
issue.)
) ------
0 "Blitz Support Suite"0 By Red When Excited.A (A Commercial product - price unknown. On four disks.)
9 Email: redwhen@ldngedge.demon.co.uk
> Webpage: http://www.aber.ac.uk/~ngh94/rwe.html
H Realmail: Red When Excited Ltd, 2 Slimmons Drive, St. Albans, Herts,. AL4 9AS, ENGLAND.
LThis contains a lot of previous commands already released on the BUMs by RedLWhen Excited, plus some new ones, AmigaGuide docs to them, some supportLprograms and their latest version of SuperTed and the Red Debugger. See theLfull review of Blitz Support Suite in the Reviews section of this issue of
) ------
, "HelpApp 1.1". By Rupert Henson.B (E-Mail ware: WB2+ required. Released 27th Feb. 1995.)
4 Email: rjh@cs.nott.ac.uk
LRealmail: Mr Rupert Henson, "Regency House", 14 Crown Road, Great Yarmouth,7 Norfolk, NR30 2JN, UNITED KINGDOM.
L This is a program written in Blitz which gives info on the flags and tagsLused by screens, windows, gadgets, GadTools, ASL requesters and slices. ItLalso works both ways, meaning if you enter a value it'll show you whichLflags are being used. In the case of tags, a window on each one can beLopened which gives a bit of info on them. One other useful feature is itsLinsert hotkey. After selecting a flag or tag using HelpApp, you can returnLto your Blitz editor and enter the value directly into your program by using
HelpApp's insertion hotkey.L As HelpApp covers more than is in the Acid manuals it's of obvious use toLall Blitz users. For instance, this is where I first found out how to turn on the WB3+ menu colours. Beware#though that there's a few errors in this version of the program. For$example, the hi-res flag for screens#is given as $80000, not $8000 as it
should be.$ Oh yes, and HelpApp adds its name$to the Workbench's `Tools' menu when
put to sleep. How's he do that?"
------
7 "The BlitzOp Guide v1.0 - 47 tips"- By Paul Bowlay.@ (Freeware: An AmigaGuide Document. Released 1997.)
2 Email: cat@aic.net.au
2 Realmail: Not telling...
L This AmigaGuide document offers 47 tips (plus a few more generalisedLones) on how to optimise your Blitz code. Optimise in this case means how toLmake your Blitz executables smaller, and that's all it means as speed isn'tLconsidered. That said, a lot of the tips here would probably speed up your(code a bit too, which is an added bonus.L Ideas for optimising are along the lines of using the windows' flags forLactivating them instead of using the Activate command, and with replacingLthe Acid commands with library calls. Also, he suggests replacing commandsLwith machine code quite a bit, which is all very well if you're familiar+with it, but a bit worrisome if you're not.L With this I noticed one mild oversight regarding the use of the IfLcommand. The suggestion is to replace "If a=1 Then..." with "If a Then..."Lon the grounds that the condition will return true if it's a "1" but not ifLit's a "0". In actual fact true will be returned as long as any non-zeroLvalue is used, so you can use this test for any number and not just for "1"
as is implied in the text.L On reading BlitzOp Guide I had the obvious thought that a program couldLbe written that would take a Blitz listing and automatically optimise it.LAnybody willing to have a shot at it? Or is this another thing I'll have to
do myself...
) ------
5
[35mFinally...
LAnd that's about it for this issue. However, for those interested in theLfuture of Blitz, I received the following note from Simon Armstrong of Acid!Software when I received BUM10...
"Hi Carl,
LFeel free to pass copies on to anyone who wants them. Sad to say, we'veFcrossed the big divide and struggling for our lives on the other side.
Ciao,
Simon."
LAs BUM10 includes a full working copy of v1.1 of Blitz, I guess this meansLthe language, if not the paper manuals, is now freeware. (I've also beenLtold it appeared on a coverdisk a while back, which means it was goingLpretty cheap then, if not totally free.) I guess the above also means thatLMark Sibly and Simon Armstrong are now PC persons, which is a bit sad butLunderstandable in today's Amiga market. However, if the Amiga does makeLanything of a comeback and they bomb out in the PC world, who knows, perhaps/they'll come back - and finally finish Blitz...